Repository navigation
fix(fields): the fill-in dialog judges option visibleWhen on the record the write would leave - #37264
Conversation
…rd the write would leave The required-fields fill-in dialog rendered each control with no record, so an option visibleWhen reading the field the change writes (a loss reason shown only while stage is closed_lost) was judged on an empty record and every option was hidden. The collector already judges the prompt on the stored record merged with the change; each returned field now carries that record, and the dialog hands it, with the values typed so far, to every control as dependentValues. Claude-Session: https://claude.ai/code/session_01QSeKYpEsWWE9Y5YtSsDgqZ Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ 席位核对 — REWORK · L1 · head
|
…the dialog's record now resolves The changeset declares Clause-② yes (widening) for the optional `record` member on the exported RequiredWhenPromptField, and states the defect as the dialog handing its controls no record: option visibility, dependsOn gates, dependent-lookup filters and a record-following currency now resolve on the record the change would leave. Adds the win_reason mirror pin (a move to closed_won offers the won-only reasons). Claude-Session: https://claude.ai/code/session_01QSeKYpEsWWE9Y5YtSsDgqZ Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ Contract reviewServed-tier: ① Derived judgments
② Semver level
③ Boundary flags
Implemented-by: VERDICT: PASS |
|
repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ 席位核对 — REWORK · L1 · head
|
…ord used to let through Claude-Session: https://claude.ai/code/session_01QSeKYpEsWWE9Y5YtSsDgqZ Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ Contract reviewServed-tier:
① Derived judgments
② Semver level
③ Boundary flags
Implemented-by: VERDICT: PASS No must-fix, no should-fix. |
|
repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ 席位核对 — ACCEPT · L1 · head
|
|
repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ Landing · 2026-11-25T11:06Z · PR #37264 at
|
repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ
Fixes #37250
Clause-②: yes (widening) — the exported
RequiredWhenPromptFieldof@object-ui/fieldsgains one optional member,record?: Record<string, unknown>Metadata-protocol: none
维护者速读
What changes
The required-fields fill-in dialog rendered each control with no record at all, so an option
visibleWhenreadingrecord.*was judged on an empty record. An option list whose every option reads the field the change writes (hotcrm'scrm_opportunity.loss_reason, shown only whilestage == "closed_lost") offered nothing: the select drew its empty state and the change could not be saved.collectRequiredWhenPromptFieldsalready judges the prompt on one merge, the stored record with the change (next = { ...record, ...changes }). Each field it returns now carries that record asrecord(new optional member ofRequiredWhenPromptField).RequiredFieldsDialoghands every controldependentValues= that record with the values typed into the dialog on top, i.e. the record the write would leave. A row a host builds itself (a refusal-named field) reads the same record whenever any shown field carries one.requiredWhen/ fieldvisibleWhen/readonlyWhen: already judged onnextby the collector (unchanged); the new collector assertion pins that the carried record is that same merge.Tests
ui/packages/fields/src/__tests__/RequiredFieldsDialog.inPlace-35956.test.tsx, new top-level describe (objectstack#37250), five cases: the collector carries the merged record; a select whose options read the changed field offers them instead of the empty state; a radio offers exactly the options visible on the merged record (a won-only option stays hidden); a value typed into the dialog joins the record the other rows read; the mirror case, a select whose options are won-only, offers them on a move to closed-won.Acceptance notes
refusalFieldrows are built as{ name, def }with no record. With at least one collected field shown they now read the dialog's record; with zero collected fields (the record header's stage menu opening the dialog as a pure confirmation) a refusal-added option row reads only the typed values. Hosts:ui/packages/plugin-detail/src/renderers/recordPathStageChange.tsx,ui/packages/plugin-detail/src/InlineEditSaveBar.tsx,ui/packages/plugin-grid/src/objectGridRequiredPrompt.tsx(kanban passes norefusalField).ui/packages/plugin-timesheet/src/ObjectTimesheet.tsxadd-row dialog rendersFieldEditWidgetwith nodependentValues, so an optionvisibleWhenreading a sibling row field is judged on an empty record there too. Not a pending-change case; noted only.Verification
Two-minute check:
cd ui && pnpm --filter @object-ui/fields exec vitest run --root ../.. --maxWorkers=2 packages/fields/src/__tests__/RequiredFieldsDialog.inPlace-35956.test.tsx— expect 12/12 passed.Read first:
ui/packages/fields/src/RequiredFieldsDialog.tsx(theliveRecordmemo and thedependentValuesprop), thenui/packages/fields/src/requiredWhenPrompt.ts(record: next).Rework round 1 (head
f731d2461f2)Per the seat L1 7158746595: M1 — the widening is declared here and in the changeset; S1 — the changeset now states the condition as "the dialog handed its controls no record" and names what now resolves (option visibility,
dependsOngates, dependent-lookup filters, a money field's followed currency); N1 — awin_reasonmirror pin. Dialog file 12/12;@object-ui/fields5021 passed; type-check 0; 38/38 derived gates exit 0. Follow-up for host refusal rows: #37270.Host refusal rows (refusal-named fields with no
record) are carried by #37270.Provenance
Opened by seat repo:objectstack#4 on the maintainer's authorization in the seat session (「#37250(推送被拦):放行」). The seat's os-dev subagent's first push was refused by its permission check; it stopped without retrying. Branch
claude/issue-37250-fill-in-dialog-pending-values@57e988ac224.🤖 Generated with Claude Code
https://claude.ai/code/session_01QSeKYpEsWWE9Y5YtSsDgqZ